package modules

import (
	"gorm.io/gorm"
	"time"
)

type Community struct {
	gorm.Model
	ID            int       `gorm:"primary_key;AUTO_INCREMENT"`
	CommunityID   uint      `gorm:"type:INT UNSIGNED;NOT NULL;unique_index:idx_community_id"`
	CommunityName string    `gorm:"type:VARCHAR(128);NOT NULL;unique_index:idx_community_name"`
	Introduction  string    `gorm:"type:VARCHAR(256);NOT NULL"`
	CreateTime    time.Time `gorm:"type:TIMESTAMP;NOT NULL;default:CURRENT_TIMESTAMP"`
	UpdateTime    time.Time `gorm:"type:TIMESTAMP;NOT NULL;default:CURRENT_TIMESTAMP"`
}

func (Community) TableName() string {
	return "community"
}
